<?php
// +----------------------------------------------------------------------
// | sfadmin - Suifeng Administration
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://suifeng.tech All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: suifeng <1787585212@qq.com>
// +----------------------------------------------------------------------

namespace app\admin;

class Module
{
    public function module_info()
    {
        return array(
            'name'          =>  'admin',
            'title'         =>  '系统',
            'icon'          =>  'fa fa-desktop',
            'description'   =>  '核心模块',
            'developer'     =>  '随风',
            'website'       =>  'http://suifeng.tech',
            'version'       =>  '0.36',
            'is_system'     =>   true,
        );
    }

    public function admin_menu($tree)
    {
        $tree->add('home', array(
            'title'     =>  '首页',
            'icon'      =>  'fa fa-home',
            'url'       =>  'admin/index/index',
        ));

        $module_menu = $tree->add('admin', array(
            'title'     =>  '系统',
            'icon'      =>  'fa fa-desktop',
        ));

        $system_mgr = $module_menu->add('system_mgr', array(
            'title'     =>  '系统功能',
            'icon'      =>  'fa fa-folder-open-o',
        ));

        $system_mgr->add('setting', array(
            'title'     =>  '系统设置',
            'icon'      =>  'fa fa-wrench',
            'url'       =>  'admin/config/settings',
        ));

        $system_mgr->add('config', array(
            'title'     =>  '配置管理',
            'icon'      =>  'fa fa-cogs',
            'url'       =>  'admin/config/index',
        ));

        $system_mgr->add('upload', array(
            'title'     =>  '上传管理',
            'icon'      =>  'fa fa-upload',
            'url'       =>  'admin/upload/index',
        ));

        $permission_mgr = $module_menu->add('permission_mgr', array(
            'title'     =>  '系统权限',
            'icon'      =>  'fa fa-folder-open-o',
        ));

        $permission_mgr->add('user', array(
            'title'     =>  '用户管理',
            'icon'      =>  'fa fa-user',
            'url'       =>  'admin/user/index',
        ));

        $permission_mgr->add('group', array(
            'title'     =>  '用户组管理',
            'icon'      =>  'fa fa-sitemap',
            'url'       =>  'admin/group/index',
        ));

        $extension_mgr = $module_menu->add('extension_mgr', array(
            'title'     =>  '扩展中心',
            'icon'      =>  'fa fa-folder-open-o',
        ));

        $extension_mgr->add('module', array(
            'title'     =>  '模块管理',
            'icon'      =>  'fa fa-th-large',
            'url'       =>  'admin/module/index',
        ));

        $extension_mgr->add('option', array(
            'title'     =>  '选项管理',
            'icon'      =>  'fa fa-check-square-o',
            'url'       =>  'admin/option/index',
        ));
    }

    public function admin_permissions()
    {
        return array(
            'admin_user_mgr'    =>  '系统/用户管理',
            'admin_group_mgr'   =>  '系统/用户组管理',
        );
    }
}